<template>
  <el-dialog
    :title="ActTitle"
    :close-on-click-modal="false"
    :visible.sync="openAct"
    width="1000px"
    append-to-body
    :show-close="false"
    v-dialogDrag
  >
    <div v-if="ActTitle == '大气参数'">
      <el-table :data="ttaskEnvLists" max-height="600" border>
        <el-table-column label="序号" align="center" type="index" width="55" />
        <el-table-column
          label="大气压力 kPa"
          prop="atmosphericPressure"
          min-width="150"
          show-overflow-tooltip
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="环境温度 ℃"
          prop="ambientTemperature"
          min-width="150"
          align="center"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="绝对温度 K"
          prop="absoluteTemperature"
          align="center"
          min-width="150"
          show-overflow-tooltip
        >
        </el-table-column>

        <el-table-column
          label="绝对湿度 mb"
          align="center"
          prop="absoluteHumidity"
          min-width="150"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="相对湿度 %"
          align="center"
          prop="relativeHumidity"
          min-width="150"
          show-overflow-tooltip
        >
        </el-table-column>
      </el-table>
    </div>
    <div v-if="ActTitle == '设计参数'">
      <el-table :data="ttaskConditionParamLists" max-height="600" border>
        <el-table-column label="序号" align="center" type="index" width="55" />
        <el-table-column
          label="工况点编号"
          align="center"
          prop="conditionCode"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="气体常数 R (kJ/kg·K)"
          align="center"
          prop="gasConstantR"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="含湿量 X (kg/kg)"
          align="center"
          prop="humidityRatioX"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="压比"
          align="center"
          prop="compressionRatio"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="入口态体积流量 (m³/min)"
          align="center"
          prop="inletFlowActualM3Min"
          min-width="180"
          show-overflow-tooltip
        />
        <el-table-column
          label="标态流量(干) (Nm³/min)"
          align="center"
          prop="standardFlowDryNm3Min"
          min-width="180"
          show-overflow-tooltip
        />
        <el-table-column
          label="标态流量(湿) (Nm³/min)"
          align="center"
          prop="standardFlowWetNm3Min"
          min-width="180"
          show-overflow-tooltip
        />
        <el-table-column
          label="标态流量(湿) (Nm³/h)"
          align="center"
          prop="standardFlowWetNm3H"
          min-width="180"
          show-overflow-tooltip
        />
        <el-table-column
          label="质量流量(干) (kg/s)"
          align="center"
          prop="massFlowDryKgS"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="质量流量(湿) (kg/s)"
          align="center"
          prop="massFlowWetKgS"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="质量流量(干) (T/h)"
          align="center"
          prop="massFlowDryTH"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="进气法兰处压力 pj (bar a)"
          align="center"
          prop="inletPressurePjBarA"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="进气温度 Tj (℃)"
          align="center"
          prop="inletTempTjC"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="进气温度 Tj (K)"
          align="center"
          prop="inletTempTjK"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="相对湿度 (%)"
          align="center"
          prop="relativeHumidity"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="排气法兰处压力 (bar a)"
          align="center"
          prop="outletPressureBarA"
          min-width="180"
          show-overflow-tooltip
        />
        <el-table-column
          label="排气法兰处压力 (kgf/cm² G)"
          align="center"
          prop="outletPressureKgfCm2G"
          min-width="200"
          show-overflow-tooltip
        />
      </el-table>
    </div>
    <div v-if="ActTitle == '工况点性能参数'">
      <el-table :data="ttaskPerformancePointLists" max-height="600" border>
        <el-table-column label="序号" align="center" type="index" width="55" />
        <el-table-column
          label="工况点"
          align="center"
          prop="performanceName"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="工作转速 r/min"
          align="center"
          prop="workSpeed"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="静叶角度 °"
          align="center"
          prop="guideVaneAngle"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="多变效率"
          align="center"
          prop="polyEfficiency"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="内功率"
          align="center"
          prop="internalPower"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="出口温度"
          align="center"
          prop="outletTempK"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="出口温度"
          align="center"
          prop="outletTempC"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="轴功率 kW"
          align="center"
          prop="shaftPower"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="轴功率 kW(修正)"
          align="center"
          prop="shaftPowerCorrected"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="内功率 kW(修正)"
          align="center"
          prop="internalPowerCorrected"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="出口温度 ℃"
          align="center"
          prop="outletTempCorrected"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="多变效率 %"
          align="center"
          prop="polyEfficiencyCorrected"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="多变效率修正量 %"
          align="center"
          prop="polyEfficiencyDelta"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="等熵效率 %"
          align="center"
          prop="isentropicEfficiency"
          min-width="150"
          show-overflow-tooltip
        />
        <el-table-column
          label="多变能量头 kJ/kg"
          align="center"
          prop="polyEnergyHead"
          min-width="150"
          show-overflow-tooltip
        />
      </el-table>
    </div>
    <div v-if="ActTitle == '轴向推力'">
      <el-table :data="ttaskThrustLists" max-height="600" border>
        <el-table-column label="序号" align="center" type="index" width="55" />
        <el-table-column
          label="名称"
          prop="performanceName"
          min-width="150"
          show-overflow-tooltip
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="纯气流力 kN"
          prop="pureGasForce"
          min-width="150"
          show-overflow-tooltip
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="F（有平衡管） kN"
          prop="forceWithBalancePipe"
          min-width="150"
          show-overflow-tooltip
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="F（无平衡管） kN"
          prop="forceWithoutBalancePipe"
          min-width="150"
          show-overflow-tooltip
          align="center"
        >
        </el-table-column>
      </el-table>
    </div>
    <div v-if="ActTitle == '阻塞线'">
      <el-table :data="ttaskBlockLineLists" max-height="600" border>
        <el-table-column label="序号" align="center" type="index" width="55" />
        <el-table-column
          label="角度(°)"
          prop="angle"
          min-width="150"
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="排气法兰处压力"
          prop="dischargePressure"
          align="center"
          min-width="150"
        >
        </el-table-column>
      </el-table>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="closeAct">确 定</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { getTaskInfo } from "@/api/fileManage/entering";
export default {
  props: ["openAct", "rowId", "ActTitle"],
  data() {
    return {
      ttaskEnvLists: [],
      ttaskThrustLists: [],
      ttaskPerformancePointLists: [],
      ttaskBlockLineLists: [],
      ttaskConditionParamLists: [],
    };
  },
  watch: {
    openAct: {
      handler(newVal, oldVal) {
        // 处理逻辑
        if (newVal) {
          getTaskInfo(this.rowId).then((res) => {
            this.form = res.data;
            this.ttaskPerformancePointLists =
              this.form.ttaskPerformancePointList;
            this.ttaskBlockLineLists = this.form.ttaskBlockLineList;
            this.ttaskConditionParamLists = this.form.ttaskConditionParamList;
            this.ttaskEnvLists = this.form.ttaskEnvList;
            this.ttaskThrustLists = this.form.ttaskThrustList;
          });
        }
      },
      deep: true,
      immediate: true,
    },
  },
  methods: {
    closeAct() {
      this.$emit("closeAct");
    },
  },
};
</script>
